<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
	</head>

	<body>
		<div class="mui-content">
			<div id="div_info" style="margin: 10px 0 0 10px; height: 100px;">
				<img id="img_my_face" src="photo.jpg" width="55px" height="55px" class="mui-pull-left" style="border-radius: 5px;">
				<div class="mui-pull-left" style="margin-left: 15px; margin-top: 3px;">
					<div id="nickname" style="font-size: 20px; font-weight: 600;">爱新觉罗·L</div>
					<div id="id_txt" style="color: gray; font-size: 14px; line-height: 14px; margin: 10px 0 0 0;">微信号：123456</div>
				</div>
			</div>
		</div>
		<ul class="mui-table-view">
			<li class="mui-table-view-cell mui-media" id="friend-circle">
				<a href="javascript:;">
					<div class="mui-pull-left">dsadsa</div>
					<div class="mui-media-body">
						<p class="mui-ellipsis">想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
					</div>
					<span class="mui-pull-right">></span>
				</a>
			</li>
		</ul>
		<script src="js/mui.js"></script>
		<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init();
			mui.plusReady(function () {
				var me = app.getGlobalUserInfo();
				
				var img_my_face = document.getElementById("img_my_face");
				img_my_face.src = plus.storage.getItem(me.id.toString());
				
				var ele_friend_circle = document.getElementById('friend-circle');
				ele_friend_circle.addEventListener('tap', function () {
					mui.openWindow('friend_circle.html');
				});
								
				var div_info = document.getElementById('div_info');
			    div_info.addEventListener("tap", function () {
			    	mui.openWindow("edit.html");
			    	mui.ajax('http://192.168.1.4:8080/u/upload_file_path?filename=photo',{
			    		type:'get',//HTTP请求类型
			    		timeout:10000,//超时时间设置为10秒；
			    		success:function(data){
			    			if (data.status == 200) {
			    				fetch(data.msg, {
			    					method: "PUT",
			    					//body: file
			    				}).then(() => {
			    					console.log("succeed!");
			    				}).catch(e =>  {
			    					console.log("error");
			    				});
			    			}
			    		},
			    		error:function(xhr,type,errorThrown){
			    			
			    		}
			    	});
			    });
			});
		</script>
	</body>

</html>
